<template>
  <div>
    <div class="content">
      <van-nav-bar
        title="设置"
        left-text="返回"
        left-arrow
        @click-left="onClickLeft"
        class="top"
      />
    </div>
    <div class="body">
      <div class="box">
        <span>账号</span>
        <span style="color: rgb(150, 151, 153)" v-if="phone">{{phone}}</span>
          <span style="color: rgb(150, 151, 153)" v-else>未登录</span>
      </div>
      <div class="box">
        <span>登录账号</span>
        <div class="in-box">
          <span style="color: rgb(150, 151, 153)">未设置</span>
          <img src="../../assets/jiantou.png" alt="" />
        </div>
      </div>

      <div class="box">
        <span>安全密码</span>
        <div class="in-box">
          <span style="color: rgb(150, 151, 153)">未设置</span>
          <img src="../../assets/jiantou.png" alt="" />
        </div>
      </div>
      <div class="box">
        <span>清除缓存</span>
        <div class="in-box">
          <span style="color: rgb(150, 151, 153)">立即清除</span>
          <img src="../../assets/jiantou.png" alt="" />
        </div>
      </div>
    </div>
    <div class="foot">
      <span style="color: rgb(192, 49, 49)" @click="noLogin">退出登录</span>
    </div>
  </div>
</template>

<script>
import {mapState} from 'vuex'
export default {
    computed:{
        ...mapState(["phone"]),
    },
  methods: {
    onClickLeft() {
      history.back();
    },
    noLogin(){
        this.$store.dispatch('LOGOUT')
        history.back()
    }
  },
};
</script>

<style scoped lang="scss">
* {
  padding: 0;
  margin: 0;
 
}
.van-nav-bar__content{
  background: #fff;
  .van-nav-bar__left i{
    color: #c31313;
  }
  .van-nav-bar__text {
    color: #c31313;
  }
}
 body{
      background-color: rgb(244, 244, 244);
 }
.body {
  height: 180px;
  margin-top: 10px;
  background-color: white;
  position: relative;
  
}

.body img {
  height: 24px;
  background-color: white;
}
.body .box {
  height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgb(150, 151, 153);
  background-color: white;
  padding-left: 20px;
  padding-right: 20px;
  margin-left: 5px;
  margin-right: 5px;
}
.body .in-box {
  display: flex;
  align-items: center;
  background-color: white;
}
.foot {
  position: absolute;
  bottom: 0;
  height: 50px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: white;
}
a {
  width: 100%;
  height: 50px;
  text-decoration: none;
  color: black;
  background-color: white;
  display: flex;
  align-items: center;
}
</style>
